﻿//
// IScorBotScript.cs
//
// Authors:
//    Claus Jørgensen <10229@iha.dk>
//    Lars Rønde Hansen <09548@iha.dk>
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics.Contracts;

namespace RSD.Scripting
{
    /// <summary>
    /// Async Scripting-engine interface to be used with <see cref="IRobotController"/>.
    /// </summary>
    [ContractClass(typeof(Contracts.IScorBotScriptAsyncContract))]
    public interface IScorBotScriptAsync
    {
        /// <summary>
        /// Executes the script.
        /// </summary>
        /// <param name="script">The script to execute.</param>
        void ExecuteScriptAsync(string script, Action<ScorBotScriptException> callback = null);

        /// <summary>
        /// Executes the script.
        /// </summary>
        /// <param name="reader">TextReader for loading entire files or streams.</param>
        void ExecuteScriptAsync(TextReader reader, Action<ScorBotScriptException> callback = null);

        /// <summary>
        /// Checks syntax in script.
        /// </summary>
        /// <param name="reader">The script to execute.</param>
        void CheckScriptAsync(string script, Action<ScorBotScriptException> callback = null);

        /// <summary>
        /// Checks syntax in script.
        /// </summary>
        /// <param name="reader">TextReader for loading entire files or streams.</param>
        void CheckScriptAsync(TextReader reader, Action<ScorBotScriptException> callback = null);
    }
}
